import {RegisterPage} from "../root";
import {schema as TeamSchema} from "./team";
import {schema as OrgSchema} from "./org";
import {schema as PlatformSchema} from "./platform";
import {schema as ProfileSchema} from "./profile";
import {schema as TeamAclSchema} from "./team-acl";
import {inboxSchema, outboxSchema} from "./msg";

RegisterPage({
    path: "user",
    label: "用户中心",
    icon: "fa fa-user",
    children: [
        {
            path: "team-settings",
            acl: 'user:edit_own_team',
            label: "修改资料",
            schema: TeamSchema,
            url: "/user/team-settings"
        },

        {
            path: "org-settings",
            acl: 'user:edit_own_org',
            label: "修改资料",
            schema: OrgSchema,
            url: "/user/org-settings"
        },
        {
            path: "platform-settings",
            acl: 'user:edit_own_platform',
            label: "修改资料",
            schema: PlatformSchema,
            url: "/user/platform-settings"
        },
        {
            path: "profile",
            label: "修改密码",
            schema: ProfileSchema,
            url: "/user/profile"
        },

        {
            path: "team-acl-setting",
            label: "团队设置",
            acl: 'user:edit_team_setting',
            schema: TeamAclSchema,
            url: "/user/team-acl-setting"
        },

        {
            path: "msg",
            label: "站内信",
            url: "/user/msg",
            acl: 'user:msg',
            children: [
                {
                    path: 'inbox',
                    acl: 'user:msg',
                    schema: inboxSchema
                },

                {
                    path: 'outbox',
                    acl: 'user:msg',
                    schema: outboxSchema
                }
            ]
        }
    ]
});
